gl: Fix a rounding error in subpixel positioning
authorMatthias Clasen <mclasen@redhat.com>
Sat, 20 Mar 2021 03:17:58 +0000 (23:17 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 21 Mar 2021 20:05:10 +0000 (16:05 -0400)
1024 / 4 is 256, not 250.

gsk/gl/gskglglyphcache.c

index 9cff7d7ca1cf20a8b9b1bdf3bdc674eac4188a8a..864c741709e611584bf3996da2ed6fa1c7c80f81 100644 (file)
@@ -149,10 +149,10 @@ render_glyph (GlyphCacheKey    *key,
   glyph_info.glyph = key->data.glyph;
   glyph_info.geometry.width = value->draw_width * 1024;
   if (glyph_info.glyph & PANGO_GLYPH_UNKNOWN_FLAG)
-    glyph_info.geometry.x_offset = 250 * key->data.xshift;
+    glyph_info.geometry.x_offset = 256 * key->data.xshift;
   else
-    glyph_info.geometry.x_offset = 250 * key->data.xshift - value->draw_x * 1024;
-  glyph_info.geometry.y_offset = 250 * key->data.yshift - value->draw_y * 1024;
+    glyph_info.geometry.x_offset = 256 * key->data.xshift - value->draw_x * 1024;
+  glyph_info.geometry.y_offset = 256 * key->data.yshift - value->draw_y * 1024;
 
   glyph_string.num_glyphs = 1;
   glyph_string.glyphs = &glyph_info;